package arch.chameleon.module.security.realm.model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the CUST_ROLE database table.
 * 
 */
@Embeddable
public class CustRolePK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	private String custlevel;

	private String roleid;

	public CustRolePK() {
	}
	public String getCustlevel() {
		return this.custlevel;
	}
	public void setCustlevel(String custlevel) {
		this.custlevel = custlevel;
	}
	public String getRoleid() {
		return this.roleid;
	}
	public void setRoleid(String roleid) {
		this.roleid = roleid;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof CustRolePK)) {
			return false;
		}
		CustRolePK castOther = (CustRolePK)other;
		return 
			this.custlevel.equals(castOther.custlevel)
			&& this.roleid.equals(castOther.roleid);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.custlevel.hashCode();
		hash = hash * prime + this.roleid.hashCode();
		
		return hash;
	}
}